package home_work4;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;

public class test2 {

	public static void main(String[] args) {
		Collection <String>c = new ArrayList();
		c.add("1");c.add("$");c.add("2");
		c.add("$");c.add("3");c.add("$");
		c.add("4");
		Iterator <String>it=c.iterator();
		while (it.hasNext()) {
            String s = it.next();
            if(s.equals("$")) {
            	it.remove();
            }      
     }      
		for (String string : c) {
			System.out.println(string);
		}
	}

}
